package api.action;

import api.model.ApiMigrationTable;
import m.common.action.ActionMeta;
import m.common.action.VueResult;
import m.common.model.util.QueryCondition;
import m.html.VueListResult;
import m.html.list.ListCount;
import manage.action.ManageAction;

@ActionMeta(name="api/apiMigrationTable")
public class ApiMigrationTableAction extends ManageAction {
    /*
     * 迁移表列表
     */
    public VueResult tableList() throws Exception {
        VueListResult result=getVueListResult("迁移表列表", ApiMigrationTable.class,actionUrl("tableList"));
        result.setFunction(true,false);
        result.setHeight(-1);
        result.addCol(toIndexColumn());
        result.addCol(toTextColumn("迁移模型类", "tableClass", 200, true));
        result.addCol(toTextColumn("模型描述", "tableDesc", 150, true));
        result.addCol(toIntegerColumn("记录数量", "recordNum", 100, true));
        result.addCol(toIntegerColumn("成功数量", "successNum", 100, true));
        result.addCol(toIntegerColumn("失败数量", "errorNum", 100, true));
        result.addCol(toNumberColumn("执行进度", "exeProgress", 100, true).setNumberFormat("0.00%").setCount(ListCount.NONE));
        //排序 result.addOrder
        //查询条件 result.addCondition
        result.addCondition(QueryCondition.eq("migration.oid",getParamsValue("migration.oid")));
        return result;
    }
}
